//全局配置，保存以下信息
/**
 * 1. 服务器地址前缀 
 * 2. HBuilder 本地服务器前缀
 * 3. 数据库密钥（token）
 * 4. 用户登录后
 */
var globalData = {
	//server: "http://stuapi.ysdjypt.com/api/",
	server:"http://localhost:8080/springboot/",//接口地址
	pre:"http://127.0.0.1:8848/front/",//本地服务器前缀
	myToken:"024b5b3e-5cd4-494d-995d-aa39b6951c16",//访问秘钥
	token:localStorage.token,
	user:localStorage.user,
	setUserInfo:function(uid,uname,roleNames,rolesIds){
		sessionStorage.setItem("uid",uid);
		sessionStorage.setItem("uname",uname);
		sessionStorage.setItem("roleNames",roleNames);
		sessionStorage.setItem("rolesIds",rolesIds);
	},
	getCurUid:function(){
		return sessionStorage.getItem("uid");
	},
	getCurUName:function(){
		return sessionStorage.getItem("uname");
	},
	getRoleIds:function(){
		return sessionStorage.getItem("rolesIds");
	},
	getCurRoleNames:function(){
		var rs = sessionStorage.getItem("roleNames");
		var arr = rs.split(",");
		var data = "[";
		for(var i=0;i<arr.length;i++){
			arr[i]="\'"+arr[i]+"\'";
		}
		return eval("["+arr.join()+"]");
	}
};
document.write('<link rel="stylesheet" href="'+globalData.pre+'css/x-admin.css" type="text/css"/>');
document.write('<script src="'+globalData.pre+'lib/layui/layui.js"></script>');
document.write('<script type="text/javascript" src="'+globalData.pre+'js/x-layui.js"></script>');
document.write('<script type="text/javascript" src="'+globalData.pre+'js/x-admin.js"></script>');

